﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_thongkevechuathanhtoan : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        if (!IsPostBack)
        {
            List<ListItem> items = new List<ListItem>();
            foreach (var u in NguoiDung.UserList())
            {
                items.Add(new ListItem(u.taikhoan, u.taikhoan));
            }
            ASPxComboBox1.Items.AddRange(items.ToArray());

            //DropDownList1.DataSource = NguoiDung.GetUserName();
            //DropDownList1.DataTextField = "taikhoan";
            //DropDownList1.DataValueField = "taikhoan";
            //DropDownList1.Items.Add(new ListItem("--Please select--", "-1"));
            //DropDownList1.AppendDataBoundItems = true;
            //DropDownList1.DataBind();
            //DropDownList1.SelectedIndex = -1;
        }
        else
        {
            load();
        }
    }
   

    private void load()
    {
        string message = "";
        ASPxGridView1.DataSource = Ve.ThongKeVe(ASPxComboBox1.SelectedItem.Value.ToString(), ref message);
        ASPxGridView1.DataBind();
        Label1.Text = message;
    }
    
}